import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop005_查询流程"
# 1.点击销售管理订单管理页面
rootPath = get_pro_rootpath() #获取项目绝对路径
filePath = rootPath+r'\public\order1.txt' #拼接文件路径
orderID = readFile(filePath) #读取文件内容
print(orderID) #打印编号
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)

# 2.在订单号查询框输入
DBshopEnterMenu2(firefox,"销售管理","订单管理")
DBshopSearchOrderID(firefox,orderID)

# 断言
#订单数1是预期值
#获取当前页面订单数量
s = firefox.find_element_by_xpath("//body").text
print(s)
l = '订单数：'
r = '\)'
num = reGetString(s,l,r)
if num == "1":
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()













